package com.leetcode.algorithm.y22.m06;

/**
 * 283. 移动零
 * 
 * https://leetcode.cn/problems/move-zeroes/
 * 
 * @author jie.deng
 *
 */
public class Question0283Solution01 {

	public void moveZeroes(int[] nums) {
		int j = 0;
		for (int i = 0; i < nums.length; i++) {
			if (nums[i] != 0) {
				nums[j] = nums[i];
				j++;
			}
		}
		for (int i = j; i < nums.length; i++) {
			nums[i] = 0;
		}
	}

}
